﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiMarbleTexture : OdGiProceduralTexture
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiMarbleTexture(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiMarbleTexture_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiMarbleTexture obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiMarbleTexture()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiMarbleTexture(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdGiMarbleTexture cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMarbleTexture_cast(OdRxObject.getCPtr(pObj));
			OdGiMarbleTexture result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMarbleTexture)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMarbleTexture)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMarbleTexture)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiMarbleTexture_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiMarbleTexture_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiMarbleTexture_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdGiMarbleTexture createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMarbleTexture_createObject();
			OdGiMarbleTexture result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMarbleTexture)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMarbleTexture)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMarbleTexture)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdGiProceduralTexture.Type type()
		{
			OdGiProceduralTexture.Type result = (OdGiProceduralTexture.Type)GlobalsPINVOKE.OdGiMarbleTexture_type(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setStoneColor(OdGiMaterialColor stoneColor)
		{
			GlobalsPINVOKE.OdGiMarbleTexture_setStoneColor(this.swigCPtr, OdGiMaterialColor.getCPtr(stoneColor));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiMaterialColor stoneColor()
		{
			OdGiMaterialColor result = new OdGiMaterialColor(GlobalsPINVOKE.OdGiMarbleTexture_stoneColor(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setVeinColor(OdGiMaterialColor veinColor)
		{
			GlobalsPINVOKE.OdGiMarbleTexture_setVeinColor(this.swigCPtr, OdGiMaterialColor.getCPtr(veinColor));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiMaterialColor veinColor()
		{
			OdGiMaterialColor result = new OdGiMaterialColor(GlobalsPINVOKE.OdGiMarbleTexture_veinColor(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setVeinSpacing(double veinSpacing)
		{
			GlobalsPINVOKE.OdGiMarbleTexture_setVeinSpacing(this.swigCPtr, veinSpacing);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double veinSpacing()
		{
			double result = GlobalsPINVOKE.OdGiMarbleTexture_veinSpacing(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setVeinWidth(double veinWidth)
		{
			GlobalsPINVOKE.OdGiMarbleTexture_setVeinWidth(this.swigCPtr, veinWidth);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double veinWidth()
		{
			double result = GlobalsPINVOKE.OdGiMarbleTexture_veinWidth(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual bool IsEqual(OdGiMaterialTexture texture)
		{
			bool result = GlobalsPINVOKE.OdGiMarbleTexture_IsEqual(this.swigCPtr, OdGiMaterialTexture.getCPtr(texture));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGiMarbleTexture Assign(OdGiMarbleTexture texture)
		{
			OdGiMarbleTexture result = (OdGiMarbleTexture)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiMarbleTexture_Assign(this.swigCPtr, OdGiMarbleTexture.getCPtr(texture)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void copyFrom(OdRxObject pSource)
		{
			GlobalsPINVOKE.OdGiMarbleTexture_copyFrom(this.swigCPtr, OdRxObject.getCPtr(pSource));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
